<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateUserTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user', function (Blueprint $table) {
            $table->id("user_id");
            $table->string("user_name",20)->comment("用户名，非登录名");
            $table->string("user_email",50)->unique()->comment("邮箱，使用邮箱登录");
            $table->string("user_password",100)->comment("密码");
            $table->Integer("is_delete")->default(0)->comment("0 未删除 1 已删除");
            $table->bigInteger("create_at")->comment("创建时间");
            $table->bigInteger("update_at")->nullable($value = true)->comment("更新时间");
            $table->bigInteger("delete_at")->nullable($value = true)->comment("删除时间");
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user');
    }
}
